using System;
using System.Collections.Generic;
using NHibernate;
using SinBiota.Model.Entities;
using SinBiota.Model.Persistence.Repositories.Interfaces;

namespace SinBiota.Model.Persistence.Repositories.Implementation
{
    public class HabitatRepository : RepositoryAbstract<Habitat,int>, IHabitatRepository
    {
        public HabitatRepository(ISession session) : base(session)
        {
        }

        public Habitat FindByName(string name)
        {
            return FindByEqRestrictionUniqueResult(x => x.Name, name);
        }

        public IList<Habitat> FindByNameLike(string name)
        {
            return FindByInffix(x => x.Name, name);
        }
    }
}